from launch import LaunchDescription
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory
import os

def generate_launch_description():
    pkg_share_dir = get_package_share_directory('image_pub_shm')
    param_file = os.path.join(pkg_share_dir, 'configs', 'image_pub_shm.yaml')

    return LaunchDescription([
        Node(
            package='image_pub_shm',
            executable='image_pub_shm',
            parameters=[
                # {"image_pub_topic_name": '/image_raw'},
                # {"capture_format": '/data/road_video/project_video.mp4'},
                # {"capture_format": '/home/x/code/learn_ros2/GaoRZ_project/img/video2.webm'},
                # {"capture_format": '0'}
                param_file,
            ]
        ),
 
        # Node(
        #     package='rqt_image_view',
        #     executable='rqt_image_view',
        #     name='rgb_image_viewer',
        #     output='screen',
        #     arguments=['--on-top'],  # 添加命令行参数，使窗口置顶
        #     remappings=[
        #         ('image', '/camera/image_raw'),
        #     ],
        # ),
    ])
